home *** CD-ROM | disk | FTP | other *** search
/ Wonky Flux Batch 2019 02 / Wonky_Flux_Batch_2019-02.zip / Wonky Flux Batch 2019-02 / 089 - Misc Stuff - PD.dsk / UPCON.S < prev    next >
Text File  |  2019-02-17  |  2KB  |  87 lines

  1. ********************************
  2. *                              *
  3. *  UPCON   by Glen E. Bredon   *
  4. *                              *
  5. ********************************
  6. *                              *
  7. *  Takes a MERLIN source file  *
  8. * and converts all lower case  *
  9. * comments commencing with "*" *
  10. * or " ;" to upper case.       *
  11. *                              *
  12. ********************************
  13. *                              *
  14. * With source file in memory   *
  15. * BRUN UPCON from EXEC mode.   *
  16. *                              *
  17. ********************************
  18.  
  19. PL        = 0
  20. SOURCE    = $A
  21. ENDSRC    = $E
  22.  
  23. ********************************
  24.  
  25.           DO 0
  26.  
  27. INCR      MAC
  28.           INC ]1
  29.           BNE NI
  30.           INC ]1+1
  31. NI        <<<
  32.  
  33. TRDB      MAC
  34.           LDA ]1
  35.           STA ]2
  36.           LDA ]1+1
  37.           STA ]2+1
  38.           <<<
  39.  
  40.           FIN
  41.  
  42. ********************************
  43.  
  44.           ORG $280
  45.  
  46.           >>> TRDB.SOURCE;PL
  47.           LDY #0
  48. FIRSTCHR  LDA (PL),Y     ;Get 1st character on line
  49.           CMP #"*"       ;Check if whole line a comment
  50.           BEQ COMMENT
  51.           CMP #"         ;"
  52.           BEQ COMMENT
  53. GOTHRU    JSR GETBYTE    ;Otherwise, look for " ;"
  54. SPACE?    CMP #" "
  55.           BNE GOTHRU
  56.           JSR GETBYTE
  57.           CMP #"         ;"
  58.           BNE SPACE?
  59. COMMENT   JSR GETBYTE    ;Now we are in comment,
  60.           CMP #%11100000 ; so change all lower case
  61.           BLT COMMENT    ; to upper case.
  62.           AND #%11011111
  63.           STA (PL),Y     ;Put it back
  64.           BNE COMMENT    ;Loop till at end of line
  65.  
  66. GETBYTE   >>> INCR.PL
  67.           JSR DONE?      ;Check if through source
  68.           LDA (PL),Y     ;Get character
  69.           CMP #$8D       ;Is it end of line?
  70.           BNE BACK       ;Return if not
  71.           PLA            ;Pop return adrs
  72.           PLA
  73.           >>> INCR.PL    ;Point to next char
  74.           JSR DONE?      ; and check if done
  75.           BLT FIRSTCHR   ;Loop till done
  76.  
  77. DONE?     LDA PL         ;Compare PL to
  78.           CMP ENDSRC     ; end of source
  79.           LDA PL+1
  80.           SBC ENDSRC+1
  81.           BLT BACK       ;Return if not done
  82.           PLA            ;Pop 2 addresses
  83.           PLA            ; from stack
  84.           PLA            ; and return
  85.           PLA            ; to caller.
  86. BACK      RTS
  87.